#include <stdio.h>
int main()
{
	int i,j,k,y,n;
	int a[100];
	scanf("%d",&n);
	int x[n];
	for(i=0;i<n;i++)
	{
		scanf("%d",&x[i]);
	}
	for(i=0;i<n;i++)
	{
		k=0;
		for(j=1;j<=x[i];j++)
		{
			if(x[i]%j==0)
			{
				a[k]=j;
				k++;
			}
		}
		y=0;
		for(j=0;j<k;j++)
		{
			if(a[j]%2==0)
			{
				y++;
				printf("%d ",a[j]);
			}
		}
		if(y==0)
		{
		    printf("%d has no even factors\n",x[i]);	
		}
	}
	return 0;
}
